import java.util.Scanner;

public class Test {

    //排个序

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //在此输入您的代码...
        int n = sc.nextInt();
        int m = sc.nextInt();

        int[] a = new int[n];
        for(int i=0;i<n;i++){
            a[i] = sc.nextInt();
        }

        int[] p = new int[m];
        for(int i=0;i<m;i++){
            p[i] = sc.nextInt();
        }

        for(int x = 0;x < m;x++) {
            for(int i = 0 ; i < m ; i++){
                int j = p[i];
                if(j < n) {
                    if(a[j-1] > a[j]){
                        int temp = a[j-1];
                        a[j-1] = a[j];
                        a[j] = temp;
                    }
                }
            }
        }

        boolean flag = true;
        for(int i=0;i<n-1;i++){
            if(a[i] > a[i+1]){
                flag = false;
                break;
            }
        }
        if(flag) {
            System.out.println("YES");
        }else {
            System.out.println("NO");
        }


        sc.close();
    }

}
